Specifications for DocView Integration with external databases. The following setup is required to integrate the external database with DocView: A SETUP.SSU file located in the DocView's directory (the directory that holds the docview.exe file) must hold the following pieces of data, each placed on a separate line. The line sequence is significant; if optional data is not specified, the line must be left blank. If the SETUP.SSU is missing or incomplete, certain menu items and toolbar buttons are removed from the screen. Without the SETUP.SSU file, the DocView program becomes a basic document viewer. Images can be viewed via the DocView program by a DOCVIEW.EXE FILENAME.XXX command (where FILENAME.XXX is the path name of the image file. DocView can also be launched from many Windows applications, such as internet browsers. The recommended interface is with DDE (Dynamic Data Interchange). If your database application does not support DDE, the interface can be accomplished with the SendKeys method. For details on the SendKeys method, please read the section below. USING THE DDE METHOD - THE RECOMMENDED METHOD ********************************************** Example of a SETUP.SSU file (for MSACCESS 2.0 DATABASE) -------------------------------------------------------- MSAccess|EditForm TheField ====leave this line blank---- MSAccess|QueryForm TheField ----leave this line blank==== D:\DOCS 60 60 0 Lines 1-3 contain information about the external database's EDITING subsystem: Line1 is the DDE TOPIC (in the MS Access database system). Line2 is DDE ITEM (in the MS Access database system). Line3 (leave this line blank) Lines 4-6 contain information about the external database's QUERY subsystem: Line 4 is the DDE TOPIC (in the MS Access database system). Line 5 is DDE ITEM (in the MS Access database system). Line 6 (leave this line blank) Line7 (optional) specifies the fixed path name of the directory that holds the image files. This is required only if the image address in the database does not include the directory name. Line 8 is the width of the image display window. If the value is 100 or less, the entry represents a percentage of the screen width, otherwise it is measured in twips (1440 twips = 1 inch; 576 twips = 1 cm). Line 9 is the height of the image display window. If the value is 100 or less, the entry represents a percentage of the available screen height, otherwise it is measured in twips (1440 twips = 1 inch; 576 twips = 1 cm). Line 10 specifies the opening state of the parent (MDI) window: blank or 0 = normal 1 = minimized 2 = maximized 3 = Fit-to-image Line 11 represents other options: nosave = the Save As option in the image windows is suppressed In the database application, you must create a script or a function for a DDE POKE. Use the following specifications: Application = Docview Topic = Linkform Item = Linkbox EXAMPLE OF A CODE IN THE MS ACCESS APPLICATION: ----------------------------------------------- Sub TheButton_Click() 'executed when the user clicks on the TheButton. Dim Chan as integer Dim x as integer On error resume next Chan = DDEInitiate("Docview","Linkform") ' Establish a DDE link if err <> 0 then ' if DocView is not yet running ..... x = shell("C:\docview\docview.exe",3) 'start up Docview Chan = DDEInitiate("Docview","Linkform") 'Establish a DDE link err = 0 endif DDEPoke Chan, "Linkbox", [Thefield] 'Poke the data to DocView DDETerminateAll 'Close the DDE link End Sub EXAMPLE OF A CODE IN AN VISUAL BASIC APPLICATION ------------------------------------------------ Sub Command1_Click () On Error Resume Next ddelink.LinkMode = 0 ddelink.LinkTopic = "Docview|Linkform" ddelink.LinkItem = "Linkbox" ddelink.LinkMode = 2 If Err = 282 Then dummy = Shell("c:\docview\install\docview.exe", 1) ddelink.LinkMode = 2 End If ddelink.Caption = text1 ddelink.LinkPoke ddelink.LinkMode = 0 End Sub The database application will send (poke) the following data string to DocView: ffffffff,ttttttttt ffffffff,ttttttttt ffffffff,ttttttttt where fffffff is the file name (with path and extension), and ttttttt is the optional title (description) of the image. The title, if used, will be displayed in the title bar of the image. Up to 30 items can be listed. Please refer to the database application's user guide for the DDE syntax. Sending data from DocView to the database application ----------------------------------------------------- When the user clicks on the Edit button (pencil) or the Query button (question marks) in the toolbar of DocView, DocView pokes the file name of the currently displayed image to the database application. The information is sent to the form and field specified in the Setup.ssu file (lines 1,2 and 4,5, see above). In the database application, you need to write the appropriate code to handle the poked data. (VB Programmers please note: The 'receiving' form must have the linkmode set to 1 and the linktopic must agree with the topic specified in the setup.ssu file.) For support, contact Informatik Inc. at 610.640.0339 or support@informatik.com. **************************************************************** **************************************************************** (If you use the DDE method, ignore the following section.) THE 'SENDKEYS METHOD' ********************* ************************************************************************** Method B (using SendKeys function) ---------------------------------- C:\ACCESS\MSACCESS.EXE C:\DBDIR\MYDB.MDB Microsoft Access %(FU)DVMACRO1{ENTER} C:\ACCESS\MSACCESS.EXE C:\DBDIR\MYDB.MDB Microsoft Access %(FU)VDMACRO2{ENTER} D:\DOCS 7200 6000 2 Lines 1-3 contain information about the external database's EDITING subsystem: Line 1 is the path/file name of the external database application. If you do not integrate, enter 'None'. Line 2 is the precise name of the external database application as shown in its title bar. If you don not integrate, enter 'None'. Line 3 represents the 'SendKeys' string for activating the external database application (more information below). Lines 4-6 contain information about the external database's QUERY subsystem: Line 4 is the path/file name of the external database application. If you do not integrate, enter 'None'. Line 5 is the precise name of the external database application as shown in its title bar. If you don not integrate, enter 'None'. Line 6 represents the 'SendKeys' string for activating the external database application (more information below). Line7 (optional) specifies the fixed path name of the directory that holds the image files. This is required only if the image address in the database does not include the directory name. Line 8 is the width of the image display window. If the value is 100 or less, the entry represents a percentage of the screen width, otherwise it is measured in twips (1440 twips = 1 inch; 576 twips = 1 cm). Line 9 is the height of the image display window. If the value is 100 or less, the entry represents a percentage of the available screen height, otherwise it is measured in twips (1440 twips = 1 inch; 576 twips = 1 cm). Line 10 specifies the window status: blank or 0 = normal 2 = maximized 1 = minimized ************************************************************************** The characters are not case sensitive, except possibly line 3 and line 6. Lines 1 and 2 and lines 4 and 5 may (but need not necessarily) be identical. In the database application, you must create a 'SendKeys' script or function. If you use the 'SendKeys' link method, read and follow the instructions below: In the external database application, you must create a script/macro that copies the following data to the Windows clipboard, activates DocView and send the F12 keystroke to DocView. #F#xxxxxxxx.xxx,tttttttttt xxxxxxxx.xxx,tttttttttt xxxxxxxx.xxx,tttttttttt Where #F# is a fixed starter tag, xxxxxxxxxx.xxx is the file name of the image. The directory path must be included unless it is declared in the third line of the SETUP.SSU file (see above). tttttttttt is the optional description of the file that will be used in the image displays title bar. If the tttttttttt is blank, the system uses the file name as a description. If the tttttttttt is not used, the comma can be omitted. Normally, you will only have one line, one file. If you specify multiple lines, the DocView program can display all the listed images in sequence by pressing a 'Next' button. As an example, a macro in Access 2.0 that sends the following keysstrokes (SendKeys) will activates DocView: ^({ESC})<{Enter}{F12} When the DocView user requests the external application's EDIT Form, DocView copies a #E#xxxxxxxx.xxx string to the Windows clipboard, starts up or activates the external application specified in lines 1 and 2 and send the keystrokes specified in line 3 of The SETUP.SSU file to the external edit application. The xxxxxxxx.xxx parameter represents the path/file name of the currently active image in DocView. If line 7 of the SETUP.SSU specifies a global directory path, the matching path is removed from the parameter. The #E# is an identifier flag. The SendKeys keystrokes would normally include the commands for executing a macro in the external database application that will pick up the image file name in the Windows Clipboard and process it. When the DocView user requests the external application's QUERY Form, DocView copies a #Q#xxxxxxxx.xxx string to the Windows clipboard, starts up or activates the external application specified in lines 4 and 5 and send the keystrokes specified in line 6 of The SETUP.SSU file to the external edit application. The xxxxxxxx.xxx parameter represents the path/file name of the currently active image in DocView. If line 7 of the SETUP.SSU specifies a global directory path, the matching path is removed from the parameter. The #E# is an identifier flag. The SendKeys keystrokes would normally include the commands for executing a macro in the external database application that will pick up the image file name in the Windows Clipboard and process it. SendKeys In the example above, the %(FU)VDMACRO1{ENTER} has the following meaning: After opening the external application, the system sends the F and U keystrokes, both while pressing the Alt key (as symbolized by the percent sign). The F open the File menu and the U opens the Macro Request. The letters V D M A C R O 1 are sent followed by the Enter key. VDMACRO1 is the assumed macro name (it can of course be any name). For more details on the SendKeys syntax, please consult the application's documentation, or contact Informatik Inc. ************************************************************************************* For support, contact Informatik Inc. at 610.640.0339 or support@informatik.com.